package com.csx.orm.mybatis.diy.util;

import java.lang.reflect.ParameterizedType;

/**
 * <p> what does this class do ? </p>
 * <p> How does it work ?</p>
 * <p> Why does it do this ?</p>
 *
 * @author cuisongxu
 * @date 2023/11/30 周四 14:28
 */
public class ClassUtils {

    public static Class<?> getEntityClass(Class<?> mapperClass) {
        ParameterizedType type = (ParameterizedType) mapperClass.getGenericInterfaces()[0];
        return (Class<?>) type.getActualTypeArguments()[0];
    }
}
